<?php $this->headLink()
->appendStylesheet($this->js('css/jquery.alerts.css'))
?>
<?php $this->headScript()
->appendFile($this->js('plugins/jquery.alerts.js'))
->appendFile($this->js('jquery-ui/ui/jjquery.ui.widget.js'))
->appendFile($this->js('jquery-ui/ui/jquery.ui.accordion.js'))
->captureStart()?>
$(document).ready(function(){
    $("#accordion").accordion({active: <?php echo $this->actionId?>});

    <?php if ($this->message):?>
    var res = <?php echo $this->message?>;

    	if (res.error) {
        	var message = '';
        	$.each(res.error,function(i,val){
        			$("#"+i).addClass('ui-state-error');
        			$.each(val,function(ii,vv){
        				message += $("#"+i+"-label label").html()+': '+ vv+ "\n";
        			});
        	});
        	jAlert(message, '<?php echo $this->translate('checking errors')?>');
    	}
    	else {
    	jAlert('ok','<?php echo $this->translate('set completed')?>');
    	}
    <?php endif?>
});
<?php $this->headScript()->captureEnd()?>
<div id="accordion">
    <h3><a href="#"><?php echo $this->translate('student parameter')?></a></h3>
    <div>
    <?php echo $this->studentForm?>
    </div>
    <h3><a href="#"><?php echo $this->translate('student score parameter')?></a></h3>
    <div>
    <?php echo $this->scoreForm?>
    </div>
</div>
